import request from '@/utils/request'
// 获取人员列表
export const getPeopleList = (params) => request({
  method: 'GET',
  url: '/user-service/user/search',
  params
})
// 新增人员
export const addPeople = (data) => request({
  method: 'POST',
  url: '/user-service/user',
  data
})
// 删除人员
export const delPeople = (id) => request({
  method: 'DELETE',
  url: '/user-service/user/' + id
})
// 获取人员详情
export const getPeopleDetail = (id) => request({
  method: 'GET',
  url: '/user-service/user/' + id
})
// 修改人员信息
export const updatePeople = (data) => request({
  method: 'PUT',
  url: '/user-service/user/' + data.id,
  data
})

// 区域列表
export const getRegion = () => request({
  method: 'GET',
  url: 'vm-service/region/search'
})
// 获取角色列表
export const getRoleList = () => request({
  method: 'GET',
  url: '/user-service/role'
})

// 统计

export const getStatsList = (start, end) => request({
  method: 'GET',
  url: `/task-service/task/taskReportInfo/${start}/${end}`
})
// 工单统计
export const getWorkState = (start, end) => request({
  method: 'GET',
  url: `/task-service/task/collectReport/${start}/${end}`
})

// 工作量统计
export const getUserWorkList = (params) => request({
  method: 'GET',
  url: '/user-service/user/searchUserWork/',
  params
})
// 获取工作量详情
export const getUserWorkDetail = (params) => request({
  method: 'GET',
  url: '/task-service/task/userWork/',
  params
})

// 首页
// 获取订单数
export const getOrderCount = (start, end) => request({
  method: 'GET',
  url: '/order-service/report/orderCount/',
  params: {
    start,
    end
  }
})
// 获取销售额
export const getorderAmount = (start, end) => request({
  method: 'GET',
  url: '/order-service/report/orderAmount/',
  params: {
    start,
    end
  }
})
